<?php
class SiteModel extends MongoModel{
    var $table  = 'site';
    var $name = '网站';
    
    public function get_by_domain($domain, $columns=null){
    	$site_info = self::get_by_attrs(array('domains' => $domain));
    	return $site_info;
    }
    
	/**
	 * 获取网站基本信息
	 * @param string $site_id
	 */
	public function get_site($site_id, $columns=null){
		$cache = get_cache_service();
		$site_cache_key = DOMAIN . '_' . CACHE_KEY;
		$site_info = $cache->get($site_cache_key);
		if($site_info == null){
			$site_info = self::get_by_key($site_id, $columns);
			$cache->set($site_cache_key, $site_info);
		}
		return $site_info;
	}
	
	public static function get_status(){
		return array('0'=>'网站建设中', '1'=>'运行中', '2'=>'暂停服务', '3'=>'终止服务');
	}
}